﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static ShiYan3.Login;

namespace ShiYan3
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void button_maneger_Click(object sender, EventArgs e)
        {
            if (Mtype == "1")
            {
                ManegerForm maneger = new ManegerForm();
                maneger.Show();
            }
            else
            {
                MessageBox.Show("权限不够", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            }
        }

        private void Main_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
        }

        private void button_dish_Click(object sender, EventArgs e)
        {
            new DishForm().Show();
        }

        private void button_quit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            if (Mtype == "0")
            {
                button_maneger.Visible = false;
            }
        }

        private void button_table_Click(object sender, EventArgs e)
        {
            new Table().Show();
        }

        private void button_Click(object sender, EventArgs e)
        {
            new OrderInfo().Show();
        }
    }
}
